USE [i8office]
GO

if(exists(select * from sys.objects where name = 'proc_wkf_nodefield'))
	drop proc proc_wkf_nodefield
go
create proc proc_wkf_nodefield(
	@MessageID nvarchar(36),
	@TemplateMessageID nvarchar(36),
	@DocID nvarchar(36)
)
as
	INSERT INTO [dbo].[WKF_NodeField]
			   ([MessageID]
			   ,[NodeKey]
			   ,[DocID]
			   ,[FieldKey]
			   ,[Control])
		SELECT @MessageID
			  ,[NodeKey]
			  ,@DocID
			  ,[FieldKey]
			  ,[Control]
		  FROM [dbo].[WKF_NodeField]
		  WHERE MessageID=@TemplateMessageID

